/*  This program is free software: you can redistribute it and/or modify
 *  it under the terms of the GNU General Public License as published by
 *  the Free Software Foundation, either version 3 of the License, or
 *  (at your option) any later version.
 *
 *  This program is distributed in the hope that it will be useful,
 *  but WITHOUT ANY WARRANTY; without even the implied warranty of
 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 *  GNU General Public License for more details.
 *
 *  You should have received a copy of the GNU General Public License
 *  along with this program.  If not, see <http://www.gnu.org/licenses/>.
 */
#ifndef luge_util_hh
#define luge_util_hh

#include <lua.h>
#include <gegl.h>
#include <string>

namespace luge {

/**
 * get a string representation of the gvalue (used for printing).
 */
std::string gvalue_to_string (const GValue &value);

/**
 * push a gvalue onto the stack if this is possible
 * (string, int, double, boolean, color).
 * returns 1 if a value was pushed or 0 otherwise.
 */
int gvalue_push (const GValue &value, lua_State *ls);

/**
 * create a readable string for a node.
 * the returned string contains the node and all its properties.
 */
std::string node_tostring (GeglNode *node);

/**
 * create a readable short string for node (contains the operation
 * and the internal address).
 */
std::string node_toshort (GeglNode *node);

/**
 * create a copy of a node.
 * The copy has the same parameters set (for writable parameters) as node.
 * outputs will be unconnected.
 */
GeglNode *clone_node (GeglNode *node);

} /* namespace luge */

#endif
